<template>
  <div class="header">
      <div class="l-content">
        <el-button size="small" @click="changeCollapse()">
          <component class="icons"   is="menu"></component>
        </el-button>
        <el-breadcrumb separator="/" class="bread">
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
      <div class="r-content">
        <el-dropdown >
    <span class="el-dropdown-link">
      <img :src="getImgUrl('user')" class="user">
    </span>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item command="a"> 个人中心</el-dropdown-item>
              <el-dropdown-item command="b">退出</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
  </div>
</template>

<script setup>
import {ref, computed} from 'vue'
//personal img
const getImgUrl=(user)=>{
  return new URL(`../assets/images/${user}.png`,import.meta.url).href
}

//changeCollapse-----------------------------------------------
import {useAllDataStore} from "@/stores/index.js";
const store=useAllDataStore()
const changeCollapse=()=>{
  store.state.isCollapse=!store.state.isCollapse
}


</script>

<style scoped scs>
.header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: #333333;
}
.icons{
  width: 20px;
  height: 20px;
}
.l-content{
  display: flex;
  align-items: center;
  .el-button{
    margin-right: 20px;
  }

}
.r-content{
  .user{
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
}
:deep(.bread span){
  color: #fff !important;
  cursor: pointer !important;
}

</style>
